package br.com.iswe.gwt.ui.client;

import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant;
import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;

public class ColumnInfo {

	private String width;
	private String propriedade;
	private String caption;
	private Widget captionWidget;
	private CellContainerBuilder cellContainerBuilder;
	private boolean hidden;
	private HorizontalAlignmentConstant horizontalAligment;
	private VerticalAlignmentConstant	verticalAligment;
	

	public ColumnInfo(String propriedade, String caption) {
		this.propriedade = propriedade;
		this.caption = caption;
	}
	
	public ColumnInfo(String width, String propriedade, String caption) {
		this(propriedade, caption);
		this.width = width;
	}
	
	public ColumnInfo(String width, 
						String propriedade, 
						String caption, 
						HorizontalAlignmentConstant horizontalAligment,
						VerticalAlignmentConstant	verticalAligment) {
		
		this(width, propriedade, caption);
		
		if (horizontalAligment != null)
			this.horizontalAligment = horizontalAligment;
		if (verticalAligment != null)
			this.verticalAligment = verticalAligment; 
	}
	
	public ColumnInfo(String propriedade, String caption, CellContainerBuilder cellContainerBuilder) {
		this(propriedade, caption);
		this.cellContainerBuilder = cellContainerBuilder;
	}

	public ColumnInfo(String width, String propriedade, String caption, CellContainerBuilder builder) {
		this(propriedade, caption, builder);
		this.width = width;
	}
	
	public ColumnInfo(String width, String propriedade, String caption, CellContainerBuilder builder, 
			HorizontalAlignmentConstant horizontalAligment,
			VerticalAlignmentConstant	verticalAligment) {
		
		this(width, propriedade, caption, builder);
		
		if (horizontalAligment != null)
			this.horizontalAligment = horizontalAligment;
		if (verticalAligment != null)
			this.verticalAligment = verticalAligment; 
	}
	
	
	public ColumnInfo(String propriedade, boolean hidden) {
		this.propriedade = propriedade;
		this.hidden = hidden;
	}

	public ColumnInfo(String caption, CellContainerBuilder cellContainerBuilder) {
		this.caption = caption;
		this.cellContainerBuilder = cellContainerBuilder;
	}

	public ColumnInfo(Widget captionWidget, CellContainerBuilder cellContainerBuilder) {
		this.captionWidget = captionWidget;
		this.cellContainerBuilder = cellContainerBuilder;
	}
	
	public ColumnInfo(String caption) {
		this.caption = caption;
	}

	public String getPropriedade() {
		return propriedade;
	}

	public void setPropriedade(String propriedade) {
		this.propriedade = propriedade;
	}

	public String getCaption() {
		return caption;
	}

	public void setCaption(String caption) {
		this.caption = caption;
	}

	public CellContainerBuilder getCellContainerBuilder() {
		return cellContainerBuilder;
	}

	public void setCellContainerBuilder(CellContainerBuilder cellContainerBuilder) {
		this.cellContainerBuilder = cellContainerBuilder;
	}

	public boolean isHidden() {
		return hidden;
	}

	public void setHidden(boolean hidden) {
		this.hidden = hidden;
	}

	public String getWidth() {
		return width;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public Widget getCaptionWidget() {
		return captionWidget;
	}

	public void setCaptionWidget(Widget captionWidget) {
		this.captionWidget = captionWidget;
	}

	public HorizontalAlignmentConstant getHorizontalAligment() {
		return horizontalAligment;
	}

	public void setHorizontalAligment(HorizontalAlignmentConstant horizontalAligment) {
		this.horizontalAligment = horizontalAligment;
	}

	public VerticalAlignmentConstant getVerticalAligment() {
		return verticalAligment;
	}

	public void setVerticalAligment(VerticalAlignmentConstant verticalAligment) {
		this.verticalAligment = verticalAligment;
	}
}
